package wikichat.android.intelimed;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ScrollView;
import android.widget.TextView;

public class ChatActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.chatpage);
		
		DatabaseHelper db = new DatabaseHelper(ChatActivity.this);
		
		
		Element element = db.getElement(2);
		
		Button bt_back = (Button)findViewById(R.id.chatBack);
		
//		TextView screen = (TextView)findViewById(R.id.chatView);
		
		TextView texto2 = new TextView(this);
		texto2.setText(element._content_text);
    	texto2.setTextSize(20);
    	
    	ScrollView caixa = new ScrollView(this); //criando frame para scroll
    	caixa.addView(texto2);
    	
    	setContentView(caixa); 

		bt_back.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent changePage = new Intent(ChatActivity.this, WIKICHATActivity.class);
				startActivity(changePage);
			}
		});
	}
}
